package com.vzoom.logdesensitization.util;

import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.vzoom.logdesensitization.jackson.XmlStrDesensitizationStringSerializer;

public class XmlMappers {

    private static final XmlMapper XML_MAPPER;

    static {
        XML_MAPPER = new XmlMapper();
        SimpleModule simpleModule = new SimpleModule();
        simpleModule.addSerializer(String.class, new XmlStrDesensitizationStringSerializer());
        XML_MAPPER.registerModule(simpleModule);
    }

    public static XmlMapper getXmlMapper() {
        return XML_MAPPER;
    }
}
